feat(book): add heRef property for stable Hebrew reference identification#40
feat(book): add heRef property for stable Hebrew reference identification#40kdroidFilter merged 1 commit intodevfrom
Conversation
|
The heref references in Bavli (or any none tanach book, with exclusion of שלחן ערוך maybe) are interesting. Perhaps I completely misunderstood the concept? |
|
@KleiKodesh The IDs of the books or lines are not fixed accross db version, which poses a problem for creating a history, an annotation system; this will be used for that purpose and perhaps for a deeplinking system. |
e2b77a4 to
66fc2ef
Compare
|
can you clarify please: what you mean by the ids of the books or lines are not fixed: |
…tion - Add heRef column to book table with index for efficient lookups - Update Book model with heRef property and KDoc documentation - Add selectByHeRef query and getBookByHeRef repository method - Update insert queries to include heRef parameter - Set heRef from title in Otzaria generator - Set heRef from heTitle in Sefaria generator This allows stable identification of books across database regenerations, similar to how line.heRef works for lines.
66fc2ef to
f06a5ea
Compare
|
@KleiKodesh The generator assigns an ID to each book in the order in which they appear in Sefaria, then Otzaria. If Sefaria decides to add a book at the beginning, this would shift the IDs of all subsequent books by one, and therefore also the IDs of the lines. As a result, these IDs are not stable and cannot be used for history, an annotation system, or even a deeplink system, which are supposed to remain consistent even if the database is updated. |
|
apoligies i understand the concept yet i am still not clear on the final result |
|
@KleiKodesh Yes, the book and line IDs will inevitably change between versions, but as far as a search engine index is concerned, I think it is simpler to rebuild it entirely for each version rather than using this pattern, because books may be removed or added and you would then have to handle all of that. |
Summary
heRefcolumn to thebooktable for stable Hebrew reference identificationline.heReffor linesChanges
heRef TEXTcolumn andidx_book_herefindexselectByHeRefqueryheRef: String?property with KDocgetBookByHeRef()methodheReffrom title (Otzaria) orheTitle(Sefaria)Test plan
./gradlew :SeforimLibrary:build./gradlew :SeforimLibrary:test